import 'package:flutter/material.dart';
import 'package:get/get.dart';

class GetXPage extends StatefulWidget {
  const GetXPage({Key? key}) : super(key: key);

  @override
  _GetXPageState createState() => _GetXPageState();
}

class _GetXPageState extends State<GetXPage> {
  var count = 0.obs;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      child: Column(
        children: [
          Obx(() => Text('$count')),
          IconButton(
            onPressed: () {
              count++;
            },
            icon: const Icon(Icons.add),
          ),
        ],
      ),
    );
  }
}
